package com.itc.dispatch.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itc.common.core.domain.R;
import com.itc.dispatch.domain.FlightDevice;
import com.itc.dispatch.domain.FlightOperationMonitoring;
import com.itc.dispatch.domain.FlightTimeExchange;
import com.itc.dispatch.domain.SysSms;
import com.itc.dispatch.domain.dto.DisFlightSearchValuePageDto;
import com.itc.dispatch.domain.dto.FlightDevicePageDto;
import com.itc.dispatch.domain.dto.SysSmsPageDto;
import com.itc.dispatch.domain.vo.FieldVo;
import com.itc.dispatch.domain.vo.FlightLinkInfoVo;
import com.itc.dispatch.service.FlightOperationMonitoringService;
import com.itc.dispatch.service.SysSmsService;
import com.itc.system.api.listener.CastAdsb;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/sys/sms")
@Api(value = "sysSmsCon", tags = "系统短信管理模块")
public class SysSmsController {

    @Autowired
    private SysSmsService sysSmsService;

    /**
     * 短信发送
     * @return
     */
    @ApiOperation(value = "短信发送")
    @PostMapping("/send")
    public R smsSend(@RequestBody @Validated SysSms sysSms){
        return sysSmsService.smsSend(sysSms);
    }

    /**
     * 短信分页查询
     * @return
     */
    @ApiOperation(value = "短信分页查询")
    @PostMapping("/page")
    public R smsPage(@RequestBody SysSmsPageDto pageDto){
        Page page = new Page();
        page.setSize(pageDto.getSize());
        page.setCurrent(pageDto.getCurrent());
        page.setSearchCount(true);
        return sysSmsService.getPage(page,pageDto);
    }

}
